Delete memory records by id [Cloud-only]
curl --request POST \
--url https://api.evermind.ai/api/v2/memory/delete_by_ids \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"memory_type": "episode",
"memory_ids": [
"665f0c8e1a2b3c4d5e6f7a8b",
"665f0c8e1a2b3c4d5e6f7a8c"
],
"reason": {
"code": "redundant"
},
"user_id": "user_123"
}
'import requests
url = "https://api.evermind.ai/api/v2/memory/delete_by_ids"
payload = {
"memory_type": "episode",
"memory_ids": ["665f0c8e1a2b3c4d5e6f7a8b", "665f0c8e1a2b3c4d5e6f7a8c"],
"reason": { "code": "redundant" },
"user_id": "user_123"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
memory_type: 'episode',
memory_ids: ['665f0c8e1a2b3c4d5e6f7a8b', '665f0c8e1a2b3c4d5e6f7a8c'],
reason: {code: 'redundant'},
user_id: 'user_123'
})
};
fetch('https://api.evermind.ai/api/v2/memory/delete_by_ids', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.evermind.ai/api/v2/memory/delete_by_ids",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'memory_type' => 'episode',
'memory_ids' => [
'665f0c8e1a2b3c4d5e6f7a8b',
'665f0c8e1a2b3c4d5e6f7a8c'
],
'reason' => [
'code' => 'redundant'
],
'user_id' => 'user_123'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.evermind.ai/api/v2/memory/delete_by_ids"
payload := strings.NewReader("{\n \"memory_type\": \"episode\",\n \"memory_ids\": [\n \"665f0c8e1a2b3c4d5e6f7a8b\",\n \"665f0c8e1a2b3c4d5e6f7a8c\"\n ],\n \"reason\": {\n \"code\": \"redundant\"\n },\n \"user_id\": \"user_123\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.evermind.ai/api/v2/memory/delete_by_ids")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"memory_type\": \"episode\",\n \"memory_ids\": [\n \"665f0c8e1a2b3c4d5e6f7a8b\",\n \"665f0c8e1a2b3c4d5e6f7a8c\"\n ],\n \"reason\": {\n \"code\": \"redundant\"\n },\n \"user_id\": \"user_123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.evermind.ai/api/v2/memory/delete_by_ids")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"memory_type\": \"episode\",\n \"memory_ids\": [\n \"665f0c8e1a2b3c4d5e6f7a8b\",\n \"665f0c8e1a2b3c4d5e6f7a8c\"\n ],\n \"reason\": {\n \"code\": \"redundant\"\n },\n \"user_id\": \"user_123\"\n}"
response = http.request(request)
puts response.read_body{
"request_id": "<string>",
"data": {
"memory_type": "<string>",
"success": true,
"deleted": 123,
"rebuild_required": false,
"targets": [
"profile"
]
}
}{}{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{}{}Memory
Delete memory records by id [Cloud-only]
Permanently delete up to 50 memories chosen by id, together with what was derived from them (extracted facts, cluster membership and search-index copies). Only “episode” is supported today.
- Every id must be well-formed; one malformed id rejects the whole request with 422 and nothing is deleted.
- Ids that do not exist, are already deleted, or belong to another tenant are skipped rather than reported — the rest of the batch is still deleted, so re-sending a batch is safe. Duplicates are collapsed.
- With the optional
user_id, ids owned by another user are skipped the same way. deletedin the response counts the memories this request actually removed.
Pass app_id and/or project_id the same way to delete only inside that app or project: an id outside it is skipped like a missing one.
A stale profile, session summary or skill left behind is reported in rebuild_required / targets; /api/v2/memory/rebuild regenerates it.
To remove memories by owner or session rather than by id, use /api/v2/memory/delete.
POST
/
api
/
v2
/
memory
/
delete_by_ids
Delete memory records by id [Cloud-only]
curl --request POST \
--url https://api.evermind.ai/api/v2/memory/delete_by_ids \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"memory_type": "episode",
"memory_ids": [
"665f0c8e1a2b3c4d5e6f7a8b",
"665f0c8e1a2b3c4d5e6f7a8c"
],
"reason": {
"code": "redundant"
},
"user_id": "user_123"
}
'import requests
url = "https://api.evermind.ai/api/v2/memory/delete_by_ids"
payload = {
"memory_type": "episode",
"memory_ids": ["665f0c8e1a2b3c4d5e6f7a8b", "665f0c8e1a2b3c4d5e6f7a8c"],
"reason": { "code": "redundant" },
"user_id": "user_123"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
memory_type: 'episode',
memory_ids: ['665f0c8e1a2b3c4d5e6f7a8b', '665f0c8e1a2b3c4d5e6f7a8c'],
reason: {code: 'redundant'},
user_id: 'user_123'
})
};
fetch('https://api.evermind.ai/api/v2/memory/delete_by_ids', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.evermind.ai/api/v2/memory/delete_by_ids",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'memory_type' => 'episode',
'memory_ids' => [
'665f0c8e1a2b3c4d5e6f7a8b',
'665f0c8e1a2b3c4d5e6f7a8c'
],
'reason' => [
'code' => 'redundant'
],
'user_id' => 'user_123'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.evermind.ai/api/v2/memory/delete_by_ids"
payload := strings.NewReader("{\n \"memory_type\": \"episode\",\n \"memory_ids\": [\n \"665f0c8e1a2b3c4d5e6f7a8b\",\n \"665f0c8e1a2b3c4d5e6f7a8c\"\n ],\n \"reason\": {\n \"code\": \"redundant\"\n },\n \"user_id\": \"user_123\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.evermind.ai/api/v2/memory/delete_by_ids")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"memory_type\": \"episode\",\n \"memory_ids\": [\n \"665f0c8e1a2b3c4d5e6f7a8b\",\n \"665f0c8e1a2b3c4d5e6f7a8c\"\n ],\n \"reason\": {\n \"code\": \"redundant\"\n },\n \"user_id\": \"user_123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.evermind.ai/api/v2/memory/delete_by_ids")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"memory_type\": \"episode\",\n \"memory_ids\": [\n \"665f0c8e1a2b3c4d5e6f7a8b\",\n \"665f0c8e1a2b3c4d5e6f7a8c\"\n ],\n \"reason\": {\n \"code\": \"redundant\"\n },\n \"user_id\": \"user_123\"\n}"
response = http.request(request)
puts response.read_body{
"request_id": "<string>",
"data": {
"memory_type": "<string>",
"success": true,
"deleted": 123,
"rebuild_required": false,
"targets": [
"profile"
]
}
}{}{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{}{}Authorizations
Body
application/json
Permanently delete the named memory records [Cloud-only].
Was this page helpful?

